﻿using System;
using System.Collections;
using System.Data;

public partial class Admin_News_QL_DoiTacGioiThieu : System.Web.UI.Page
{
    Data data = new Data();
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (Session["admin"].Equals("true") == false)
            {
                Response.Redirect("../Default.aspx");
            }
            else
            {
                FillNoiDung();
            }
        }
        catch (Exception)
        {
            Response.Redirect("../Default.aspx");
            throw;
        }
    }

    private void FillNoiDung()
    {
        if (IsPostBack==false)
        {
            DataTable table = data.GetTable_By_Name("DoiTac");
            CKEditor1.Text = table.Rows[0]["DoiTacNoiDung"].ToString();
        }
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        data.Edit_ThongTinCoDinh(CKEditor1.Text,"BieuMau");
        Response.Redirect("Default.aspx");      
    }
    protected void btnBack_Click(object sender, EventArgs e)
    {
        Response.Redirect("Default.aspx");
    }
}
